import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/post1")
public class Servlet_Post extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //super.doPost(req, resp);
        //设置数据的格式和数据的编码为 UTF-8
        resp.setContentType("text/html; charset=utf8");
        //在控制台输出信息
        System.out.println("console: Psost 响应 ");
        //在页面显示下信息
        resp.getWriter().write("Post 响应");
    }
}
